1. Field of the Invention
The present invention relates to a data processing apparatus and method for arbitrating access to a shared resource.
2. Description of the Prior Art
Within a data processing apparatus, it is known to provide one or more resources which are shared amongst a plurality of elements of the data processing apparatus. For example, the plurality of elements may take the form of a plurality of master devices, and the shared resource may take the form of a slave device with respect to which the various master devices can initiate transactions. Each transaction typically consists of an address transfer from a master device to a slave device, and one or more data transfers between the master device and the slave device. For a write transaction, these data transfers will pass from the master device to the slave device (in some implementations there will additionally be a write response transfer from the slave device to the master device), whilst for a read transaction these data transfers will pass from the slave device to the master device.
To enable each transaction to take place, a communication path needs to be established between the master device initiating the transaction, and the slave device to which the transaction is directed. If the slave device is shared amongst a plurality of master devices, then this can cause contention amongst the various master devices for access to the shared slave device, and this contention can occur at a variety of points within the data processing apparatus.
For example, dependent on the mechanism provided for establishing the communication paths, it may be possible to provide separate dedicated communication paths for each master device. However, since the slave device will typically only be able to handle one transaction at a time, this leads to contention at the input to the slave device itself, and typically it is then necessary to provide arbitration circuitry to arbitrate between multiple simultaneous access requests issued by different master devices and seeking to access the same shared slave device.
More typically, the mechanism used to establish the communication paths between master devices and slave devices is also shared amongst the various master and slave devices. Accordingly there will typically be points along the communication paths between a master device and a slave device which involve use of a shared physical connection medium, and accordingly arbitration is typically required at such points along the communication paths.
For example, a data processing apparatus may provide interconnect circuitry for coupling the various master devices and slave devices, with the interconnect circuitry providing a plurality of connection paths over which such communication paths can be established. Often, certain of the connection paths are shared between multiple devices, and accordingly arbitration circuitry is provided to arbitrate access to such connection paths. In such instances, it can be seen that the connection paths themselves form a shared resource.
In addition to there being various types of shared resource, there may also be various types of requester elements seeking access to the shared resource. Whilst a master device is one example of such a requester element, a requester element may more generally take the form of a master interface, which may be provided directly by a master device, or may instead be provided by some intermediate structure between a master device and the shared resource. Hence, by way of example, the master interface may be provided by interconnect circuitry connecting one or more master devices with one or more slave devices.
Hence, it will be appreciated that within a typical data processing apparatus, there will be a variety of shared resources and requester elements, and wherever multiple requester elements are contending for access to that shared resource, arbitration circuitry is typically provided to arbitrate amongst those requester elements so as to decide at any point in time which requester element should have access to that shared resource.
Typically, the arbitration circuitry will be configured to apply a particular arbitration policy to decide which requester element to grant access to the shared resource at any particular point in time. For example, a known arbitration scheme may use an algorithm that employs a fixed priority technique, whereby particular priority levels are associated with particular requester elements, and then when multiple requester elements are seeking to access a shared resource at the same time, the arbitration circuitry grants access to the requester element having the highest priority. An alternative known arbitration policy applies a round robin (fair share) technique, which may for example be appropriate when all of the various requester elements that may access the shared resource are considered to have equal priority, and the aim is to seek to provide each requester element with the same level of access to the shared resource.
However, the above techniques lack flexibility. To improve flexibility, commonly owned, co-pending U.S. application Ser. No. 11/727,647, the entire contents of which are hereby incorporated by reference, describes a mechanism whereby arbitration circuitry is arranged to apply an arbitration policy that comprises multiple priority groups, with each group having a different priority. Each of the requester elements is allocated to one of those priority groups such that each priority group contains at least one of the requester elements. Within each priority group the arbitration circuitry then applies a priority ordering operation to attribute relative priorities to the requester elements within that priority group. Responsive to a predetermined event, the arbitration circuitry then re-applies the priority ordering operation within at least one priority group prior to a subsequent performance of a priority determination operation used to select a winning request from the requests currently seeking access to the shared resource.
In performing the priority determination operation, the arbitration circuitry selects as the winning request the request having the highest priority. From the above-described arbitration policy, it will be appreciated that a particular request's priority will be dependent on which priority group the requester element issuing that request is associated with, and also will depend on the relative priorities attributed to the requester elements within that particular priority group. Since the priority ordering operation that determines the relative priorities within a priority group is re-applied upon occurrence of a predetermined event, the relative priorities of the requester elements within a particular priority group will vary over time (assuming that priority group contains more than one requester element).
Such an approach provides a great deal of flexibility as to the type of arbitration scheme employed by the arbitration circuitry. This flexibility is possible due to the two tier approach to prioritization, where different priorities are associated with each priority group, and then relative priorities are attributed to the requester elements within any particular priority group, with those relative priorities being recalculated following predetermined events. In one described embodiment, the predetermined event is the occurrence of the priority determination operation itself, and accordingly in such embodiments each time the arbitration circuitry selects a winning request, the priority ordering operation is re-applied, which dependent on the number of requester elements within the priority group, and the form of the priority ordering operation applied, may cause the relative priorities to change on each iteration of the priority determination operation. However, the priorities of the priority groups themselves are not changed by re-application of the priority ordering operation.
However, in accordance with the technique described in U.S. application Ser. No. 11/727,647, it is necessary to allocate each requester element to a priority group, and hence the technique operates on the assumption that all transactions issued by a particular requester element will have the same priority. However, as more and more development takes place in the area of quality of service (QoS), there is becoming a need for priority levels to be associated with individual transactions, rather than with the requester element issuing the transactions. Accordingly, it would be desirable to develop a technique which enabled a flexible priority mechanism to be employed, whilst also enabling priority levels to be set independently for transactions, rather than associating priority levels with the individual requester elements.